<!--
 * @Author         : yanyongyu
 * @Date           : 2022-09-17 09:17:06
 * @LastEditors    : yanyongyu
 * @LastEditTime   : 2022-10-20 14:07:50
 * @Description    : None
 * @GitHub         : https://github.com/yanyongyu
-->

{% from "components/timeline/added-to-project.html.jinja" import added_to_project %}
{% from "components/timeline/assigned.html.jinja" import assigned %}
{% from "components/timeline/base-ref-force-pushed.html.jinja" import base_ref_force_pushed %}
{% from "components/timeline/closed.html.jinja" import closed %}
{% from "components/timeline/comment-deleted.html.jinja" import comment_deleted %}
{% from "components/timeline/commented.html.jinja" import commented %}
{% from "components/timeline/committed.html.jinja" import committed %}
{% from "components/timeline/convert-to-draft.html.jinja" import convert_to_draft %}
{% from "components/timeline/converted-to-discussion.html.jinja" import converted_to_discussion %}
{% from "components/timeline/cross-referenced.html.jinja" import cross_referenced %}
{% from "components/timeline/demilestoned.html.jinja" import demilestoned %}
{% from "components/timeline/deployed.html.jinja" import deployed %}
{% from "components/timeline/head-ref-deleted.html.jinja" import head_ref_deleted %}
{% from "components/timeline/head-ref-force-pushed.html.jinja" import head_ref_force_pushed %}
{% from "components/timeline/labeled.html.jinja" import labeled %}
{% from "components/timeline/locked.html.jinja" import locked %}
{% from "components/timeline/mentioned.html.jinja" import mentioned %}
{% from "components/timeline/merged.html.jinja" import merged %}
{% from "components/timeline/milestoned.html.jinja" import milestoned %}
{% from "components/timeline/moved-columns-in-project.html.jinja" import moved_columns_in_project %}
{% from "components/timeline/pinned.html.jinja" import pinned %}
{% from "components/timeline/ready-for-review.html.jinja" import ready_for_review %}
{% from "components/timeline/referenced.html.jinja" import referenced %}
{% from "components/timeline/removed-from-project.html.jinja" import removed_from_project %}
{% from "components/timeline/renamed.html.jinja" import renamed %}
{% from "components/timeline/reopened.html.jinja" import reopened %}
{% from "components/timeline/review-dismissed.html.jinja" import review_dismissed %}
{% from "components/timeline/review-request-removed.html.jinja" import review_request_removed %}
{% from "components/timeline/review-requested.html.jinja" import review_requested %}
{% from "components/timeline/reviewed.html.jinja" import reviewed %}
{% from "components/timeline/transferred.html.jinja" import transferred %}
{% from "components/timeline/unassigned.html.jinja" import unassigned %}
{% from "components/timeline/unlabeled.html.jinja" import unlabeled %}
{% from "components/timeline/unlocked.html.jinja" import unlocked %}
{% from "components/timeline/unpinned.html.jinja" import unpinned %}

{% macro issue_timeline(issue) %}
<div class="ml-0 pl-0 ml-md-6 pl-md-3">
  {% set ns = namespace(issue=issue, past_events=[]) %}
  {{ commented(issue, ns, is_first=true) }}
  <div>
    {% for event in get_issue_timeline(issue) %}
    {% set _ = ns.past_events.append(event) %}
    {% if event.event == "added_to_project" %}
    {{ added_to_project(event, ns) }}
    {% elif event.event == "assigned" %}
    {{ assigned(event, ns) }}
    {% elif event.event == "base_ref_force_pushed" %}
    {{ base_ref_force_pushed(event, ns) }}
    {% elif event.event == "closed" %}
    {{ closed(event, ns) }}
    {% elif event.event == "comment_deleted" %}
    {{ comment_deleted(event, ns) }}
    {% elif event.event == "commented" %}
    {{ commented(event, ns) }}
    {% elif event.event == "committed" %}
    {{ committed(event, ns) }}
    {% elif event.event == "convert_to_draft" %}
    {{ convert_to_draft(event, ns) }}
    {% elif event.event == "converted_to_discussion" %}
    {{ converted_to_discussion(event, ns) }}
    {% elif event.event == "cross-referenced" %}
    {{ cross_referenced(event, ns) }}
    {% elif event.event == "demilestoned" %}
    {{ demilestoned(event, ns) }}
    {% elif event.event == "deployed" %}
    {{ deployed(event, ns) }}
    {% elif event.event == "head_ref_deleted" %}
    {{ head_ref_deleted(event, ns) }}
    {% elif event.event == "head_ref_force_pushed" %}
    {{ head_ref_force_pushed(event, ns) }}
    {% elif event.event == "labeled" %}
    {{ labeled(event, ns) }}
    {% elif event.event == "locked" %}
    {{ locked(event, ns) }}
    {% elif event.event == "mentioned" %}
    {{ mentioned(event, ns) }}
    {% elif event.event == "merged" %}
    {{ merged(event, ns) }}
    {% elif event.event == "milestoned" %}
    {{ milestoned(event, ns) }}
    {% elif event.event == "moved_columns_in_project" %}
    {{ moved_columns_in_project(event, ns) }}
    {% elif event.event == "pinned" %}
    {{ pinned(event, ns) }}
    {% elif event.event == "ready_for_review" %}
    {{ ready_for_review(event, ns) }}
    {% elif event.event == "referenced" %}
    {{ referenced(event, ns) }}
    {% elif event.event == "removed_from_project" %}
    {{ removed_from_project(event, ns) }}
    {% elif event.event == "renamed"%}
    {{ renamed(event, ns) }}
    {% elif event.event == "reopened" %}
    {{ reopened(event, ns) }}
    {% elif event.event == "review_dismissed" %}
    {{ review_dismissed(event, ns) }}
    {% elif event.event == "review_request_removed" %}
    {{ review_request_removed(event, ns) }}
    {% elif event.event == "review_requested" %}
    {{ review_requested(event, ns) }}
    {% elif event.event == "reviewed" %}
    {{ reviewed(event, ns) }}
    {% elif event.event == "transferred" %}
    {{ transferred(event, ns) }}
    {% elif event.event == "unassigned" %}
    {{ unassigned(event, ns) }}
    {% elif event.event == "unlabeled" %}
    {{ unlabeled(event, ns) }}
    {% elif event.event == "unlocked" %}
    {{ unlocked(event, ns) }}
    {% elif event.event == "unpinned" %}
    {{ unpinned(event, ns) }}
    {% else %}
    {{ event|debug_event }}
    {% endif %}
    {% endfor %}
  </div>
</div>
{% endmacro %}
